import React , {useState,useEffect} from 'react'
import myevents from '../utils/myevents'
function Content({arr}) {
  let [activeIndex,setActiveIndex] = useState(0)
   useEffect(()=>{
    myevents.addListener("aaa",(data)=>{
        // console.log(data);
        setActiveIndex(data)
    })
   },[])
  return (
    <div>
    <h4>{arr[activeIndex].con}</h4> 
    </div>
  )
}

export default Content